<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>

<html xmlns="http://www.w3.org/1999/xhtml" lang="">

	<head>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

		<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>

		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">

		<title><?php echo C('WEB_TITLE');?></title>

		<link rel="stylesheet" type="text/css" href="/Public/css/common.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/js/layui/css/layui.css" media="all"/>

		<link rel="stylesheet" type="text/css" href="/Public/index/css/index.css"/>

		<link rel="stylesheet" type="text/css" href="/Public/index/css/style.css"/>

		<link rel="stylesheet" href="<?php echo C('PC_ICON_HTTP');?>">

		<script type="text/javascript" >

			const moduleName = "<?php echo (MODULE_NAME); ?>";

		</script>

        <link rel="stylesheet" href="/Public/js/viewer/css/viewer.min.css">

		<script type="text/javascript" src="/Public/js/jquery-1.9.1.min.js"></script>

		<script type="text/javascript" src="/Public/js/jquery-ui.min.js"></script>

		<script type="text/javascript" src="/Public/js/cookie/jquery.cookie.js"></script>

		<script type="text/javascript" src="/Public/js/lang/<?php echo (getStrToLower(cookie('think_language'))); ?>.js"></script>

		<script type="text/javascript" src="/Public/js/colorpicker.js"></script>

		<script type="text/javascript" src="/Public/js/layer/layer.js"></script>

		<script type="text/javascript" src="/Public/js/layui/layui.js"></script>

		<script type="text/javascript" src="/Public/js/jquery.nicescroll.js"></script>

		<script type="text/javascript" src="/Public/js/clipboard.min.js"></script>

        <script type="text/javascript" src="/Public/js/feeldesk.js"></script>
<!--
		<script type="text/javascript" src="/Public/js/signature/flashcanvas.js"></script>

		<script type="text/javascript" src="/Public/js/signature/signature.min.js"></script>
-->

        <script type="text/javascript" src="/Public/index/js/index.js"></script>

<!--		<script type="text/javascript" src="/Public/js/Lodop/LodopFuncs.js"></script>-->

		<script type="text/javascript" src="/Public/js/xm-select/xm-select.js"></script>

	</head>

    <body>


    <div class="fd-right-main">

        <div class="fd-body">

            <div class="fd-main">

                <div class="fd-right-top">

                    <span class="crumb">

                        <?php if(CONTROLLER_NAME != 'Census' && CONTROLLER_NAME != 'Ticket'): $href = '/'.CONTROLLER_NAME.'/index'; ?>

                        <?php else: ?>

                            <?php $href = 'javascript:'; endif; ?>

                        <a href="<?php echo ($href); ?>"><?php echo L('USER_MANAGER');?></a>

                        <i class="layui-icon">&#xe623;</i>

                        <a class="black6"><cite><?php echo getViewName();?></cite></a>

                        

                    </span>

                    

                    

                </div>

                

    <style type='text/css'>

        .member-list {height:auto}

        .member-list .header-right{position:static;}

    </style>

    <div class="feeldesk-list">

        <div class="feeldesk-list-header member-list clearfix">

            <div class="header-left">

                <?php if(!empty($data["auth"]["create"])): ?><a href="javascript:" onclick="openFormWindow(this,'<?php echo U('create');?>')" class="createBtn" title="<?php echo L('ADD_USER');?>">
                        <i class="iconfont icon-xinzeng"></i><?php echo L('ADD_USER');?>
                    </a><?php endif; ?>

                <form id='memberForm' class="layui-form ui-block middle ml15">

                    <div class="layui-form-item mb0">

                        <div class="layui-input-inline">

                            <select name="group_id" lay-filter="member-groups" lay-search>

                                <option value=""><?php echo L('SELECT_SECTOR');?></option>

                                <?php if(is_array($data["groups"])): $i = 0; $__LIST__ = $data["groups"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["group_id"]); ?>" <?php if(($vo["group_id"]) == $group_id): ?>selected<?php endif; ?>><?php echo ($vo["group_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

                            </select>

                        </div>

                        <div class="layui-input-inline">

                            <select name="role_id" lay-filter="member-roles" lay-search>

                                <option value=""><?php echo L('SELECT_ROLE');?></option>

                                <?php if(is_array($data["roles"])): $i = 0; $__LIST__ = $data["roles"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["role_id"]); ?>" <?php if(($vo["role_id"]) == $role_id): ?>selected<?php endif; ?>><?php echo ($vo["role_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>

                            </select>

                        </div>

                    </div>

                </form>

            </div>

            <div class="header-right clearfix">

                <div class="compact-menu">

                    <a href="javascript:" id="uploadFile" title="<?php echo L('IMPORT_MEMBER');?>"><i class="iconfont icon-upload-white"></i></a>

                    <a href="/Attachs/excel/Users.xlsx" title="<?php echo L('DOWNLOAD_TEMPLATE');?>"><i class="iconfont icon-download fts16"></i></a>

                    <?php if(!empty($data["auth"]["delete"])): ?><a href="javascript:" title="<?php echo L('BATCH_DELETE');?>" class="right-radius-5 disabled" id="batchDelete" data-value="<?php echo U('Member/delete');?>" data-remind="<?php echo L('DELETE_MEMBER_REMIND');?>">

                            <i class="iconfont icon-shanchu"></i>

                        </a><?php endif; ?>

                </div>

                <form action="<?php echo ($controllerAndAction); ?>" method="get" class="fr">

                    <div class="compact-search">

                        <i class="iconfont icon-search"></i>

                        <input type="text" name="keyword" value="<?php echo ($keyword); ?>" placeholder="<?php echo L('CUSTOMER_SEARCH');?>"/>

                        <a href="javascript:" class="searchBtn"><?php echo L('SEARCH');?></a>

                    </div>

                </form>

            </div>

        </div>

        <div class="feeldesk-list-content layui-form">

            <div class="feeldesk-list-main" id="list">

                <form class="feeldesk-item" id="itemForm">

                    <table class="layui-table" lay-skin="nob">

                        <thead>

                        <tr>

                            <th><?php echo L('CHOOSE');?></th><th><?php echo L('ACCOUNT');?></th><th><?php echo L('NAME');?></th><th><?php echo L('NICKNAME');?></th><th><?php echo L('EMAIL');?></th><th><?php echo L('MOBILE');?></th>

                            <th><?php echo L('SUBORDINATE_SECTOR');?></th><th><?php echo L('ROLE');?></th><th><?php echo L('REG_TIME');?></th><th><?php echo L('STATUS');?></th><th><?php echo L('OPERATION');?></th>

                        </tr>

                        </thead>

                        <tbody>

                        <?php if(empty($data["member"])): ?><tr class="nodata center"><td colspan="11"><?php echo L('NO_DATA');?></td></tr>

                        <?php else: ?>

                            <?php if(is_array($data["member"])): $i = 0; $__LIST__ = $data["member"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>

                                    <td class="checkbox"><input type="checkbox" name="batch[]" lay-skin="primary" value=<?php echo (encrypt($vo["member_id"],'MEMBER')); ?> lay-filter="ListChoose"></td>

                                    <td><?php echo ($vo["account"]); ?></td>

                                    <td><?php echo ($vo["name"]); ?></td>

                                    <td><?php echo ($vo["nickname"]); ?></td>

                                    <td><?php echo ($vo["email"]); ?></td>

                                    <td>
                                        <?php echo ($vo["mobile"]); ?>
                                        <?php if(($callcenterAuth) == "1"): ?><i class="iconfont icon-boda blue6 icon-onclickcall" onclick="OnclickCall(<?php echo ($vo['mobile']); ?>)"></i><?php endif; ?>
                                    </td>

                                    <td><?php echo getMemberGroupName($data['groups'],$vo['group_id']);?></td>

                                    <td><?php echo ($data['roles'][$vo['role_id']]['role_name']); ?></td>

                                    <td><?php echo (getDates($vo["create_time"])); ?></td>

                                    <td>

                                        <?php if(checkUserLoginStatus($vo['last_active_time']) && ($vo['login_status'] == 1)): ?><span class="open-status enable"><?php echo L('ONLINE');?></span>

                                        <?php else: ?>

                                            <span class="open-status disable"><?php echo L('OFFLINE');?></span><?php endif; ?>

                                    </td>

                                    <td class="feeldesk-list-operate">

                                        <i class="iconfont icon-dian"></i>

                                        <div class="operate-panel hidden">

                                            <?php $id = encrypt($vo['member_id'],'MEMBER'); ?>

                                            <?php if(!empty($data["auth"]["editor"])): ?><a href='javascript:' title="<?php echo L('EDITOR');?>" onclick="openFormWindow(this,'<?php echo U('editor',['id'=>$id]);?>')">
                                                    <?php echo L('EDITOR');?>
                                                </a><?php endif; ?>

                                            <?php if(!empty($data["auth"]["delete"])): if(($vo["is_first"]) != "2"): ?><a href="<?php echo U('delete',['id'=>$id]);?>" load="delMember"><?php echo L('DELETE');?></a><?php endif; endif; ?>

                                            <?php if(!empty($data["auth"]["reset"])): ?><a href="<?php echo U('reset',['id'=>$id]);?>" load="async"><?php echo L('RESET_PASSWORD');?></a><?php endif; ?>

                                        </div>

                                    </td>

                                </tr><?php endforeach; endif; else: echo "" ;endif; endif; ?>

                        </tbody>

                    </table>

                </form>

            </div>

            <div class="feeldesk-list-footer">

                <input type="checkbox" name="" lay-skin="primary" lay-filter="ListAllChoose" title="<?php echo L('CHECK_ALL');?>">

                <?php if(!empty($data["page"])): ?><div class="user-page"><?php echo ($data["page"]); ?></div><?php endif; ?>

            </div>

        </div>

    </div>

    <script type="text/javascript">

        importExcel('member');

        layui.use('upload', function()
        {
//            删除用户
            $("a[load='delMember']").on('click',function(e)
            {
                e.preventDefault();

                var action = $(this).attr('href');

                layer.confirm("<?php echo L('DELETE_MEMBER_REMIND');?>",{icon: 3, title:language.PROMPT,offset:['100px']},function()
                {
                    $.get(action,function(data)
                    {
                        if(data.status == 0)
                        {
                            feelDeskAlert(data.msg);
                        }
                        else
                        {
                            feelDeskAlert(data.msg,data);
                        }

                    },'JSON');

                    layer.close();
                });
            });
        });

    </script>



            </div>

        </div>

    </div>

    </body>

</html>